package com.cyl.XmlDemo.web.bysj;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.messaging.handler.annotation.MessageMapping;
import org.springframework.messaging.handler.annotation.SendTo;
import org.springframework.messaging.simp.annotation.SendToUser;
import org.springframework.stereotype.Controller;

import com.cyl.XmlDemo.entity.Shout;

//@Controller
public class SignalingController {
	
	private Logger logger = LoggerFactory.getLogger(SignalingController.class);

	@MessageMapping("/create-join")
	public void enter(){
		
	}
	
	@MessageMapping("/test-private")
	@SendToUser("/queue/private")
	public Shout test_private(Shout msg){
		logger.debug("/test 被调用  Recived Msg: "+msg.getMessage());
		Shout shout = new Shout();
		shout.setMessage("该信息发自服务端  private");
		return shout;
	}
	
	@MessageMapping("/test-common")
	@SendTo("/queue/common")
	public Shout test_common(Shout msg){
		logger.debug("/test 被调用  Recived Msg: "+msg.getMessage());
		Shout shout = new Shout();
		shout.setMessage("该信息发自服务端 common");
		return shout;
	}
	
}
